package com.pennywise.model;

import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotBlank;
import lombok.Data;

import javax.validation.constraints.DecimalMin;
import javax.validation.constraints.NotNull;
import java.math.BigDecimal;
import java.time.LocalDateTime;

/**
 * 交易记录实体类
 */
@Data
@Schema(description = "交易记录")
public class Transaction {
    @Schema(description = "ID")
    private Long id;
    
    @NotNull(message = "金额不能为空")
    @DecimalMin(value = "0.01", message = "金额必须大于0")
    @Schema(description = "金额")
    private BigDecimal amount;
    
    @NotBlank(message = "类型不能为空")
    @Schema(description = "类型")
    private String type;  // 使用字典表中的值
    
    @NotBlank(message = "分类不能为空")
    @Schema(description = "分类")
    private String category;  // 使用字典表中的值
    
    @Schema(description = "描述")
    private String description;
    
    @NotNull(message = "交易时间不能为空")
    @Schema(description = "交易时间")
    private LocalDateTime transactionTime;
    
    @Schema(description = "创建时间")
    private LocalDateTime createTime;
} 